package com.yanqu.road.server.cmd.unionwar;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.unionwar.CrossUnionWarProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.manager.unionwar.CrossUnionWarMgr;

//@Cmd(code = Protocol.C_CROSS_UNION_WAR_RECALL_PATRONS, desc = "商会战召回门客")
public class CrossUnionWarRecallPatronsCmd extends CrossCommand {

    private int activityId;
    private int stageNo;
    private int roundNo;
    private String unionUid;
    private long userId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CrossUnionWarProto.CrossUnionWarRecallPatronsReqMsg reqMsg = CrossUnionWarProto.CrossUnionWarRecallPatronsReqMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        stageNo = reqMsg.getPhase();
        roundNo = reqMsg.getSession();
        unionUid = reqMsg.getUnionUid();
        userId = reqMsg.getUserId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossUnionWarMgr.removeUnionWarPatrons(activityId, stageNo, roundNo, unionUid, serverId, userId, 0);
    }

    @Override
    public void sendData() {

    }
}
